
// Copyright (C) 2007 Richard Uhler
// This file is part of Esiply.
//
// Esiply is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License, Version 2,
// as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

#ifndef _ERROR_OBJECT_H_
#define _ERROR_OBJECT_H_


class Object;
class Scope;
class String;
class Value;

enum ErrorType
{
    ET_ERROR,
    ET_EVAL,
    ET_RANGE,
    ET_REFERENCE,
    ET_SYNTAX,
    ET_TYPE,
    ET_URI,
};

void error_init(Scope* scope);

Value* esiply_throw(ErrorType type, const char* str);

class Error
{
public:
    static Object* prototype;
    static String* name;
};

class TypeError
{
public:
    static Object* prototype;
    static String* name;
};

class RangeError
{
public:
    static Object* prototype;
    static String* name;
};

class EvalError
{
public:
    static Object* prototype;
    static String* name;
};

class ReferenceError
{
public:
    static Object* prototype;
    static String* name;
};

class SyntaxError
{
public:
    static Object* prototype;
    static String* name;
};

class URIError
{
public:
    static Object* prototype;
    static String* name;
};

#endif//_ERROR_OBJECT_H_

